import React, { Component, Fragment } from 'react'

export default class Com extends Component {
    state = {
        flag: true,
        list: ['aa', 'bb', 'cc']
    }
   
    render() {
        const { flag, list } = this.state
        let h3 = <h3 className={ flag? 'block': 'none' }>我是标题</h3>
        return (
            <div>
                {/* v-show */}
                {/* { h3 } */}
                {/* v-bind */}
                {/* v-if */}
                {/* {
                    flag? <h3>我是标题</h3>: <Fragment></Fragment>
                } */}
                {/* v-for */}

                {/* 加多个类名 */}
                {/* <div className = { list.join(' ') }>12</div> */}

                {/* 加行内样式  * 必须是对象的形式 */}
                {/* <div style={{
                    color: 'red',
                    width: 100
                }}>行内</div> */}
                

                {/* <button onClick = { () => {
                    this.setState({
                        flag: !this.state.flag
                    })
                } }>
                    显示
                </button> */}
            </div>
        )
    }
}
